using System;
using System.Windows.Forms;
using Microsoft.Xna.Framework.Graphics;


namespace Jemgine.MapEditor
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static class Program
    {

        [STAThread]
        static void Main()
        {

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

			EditorState EditorState = new EditorState();

			DockingWindow DT = new DockingWindow();

			EditorState.Services.AddService<IGraphicsDeviceService>(GraphicsDeviceService.AddRef(DT.Handle, 1, 1));

            if (EditorState.PrepareEpisodeContent())
            {
                DT.SetEditorState(EditorState);
                EditorState.NewMap();

                Application.Run(DT);

                EditorState.SaveConfig();
            }
        }
    }
}
